//---------------------------------------------------------------------------

#ifndef pcalcH
#define pcalcH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <Menus.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class Tpcfrm : public TForm
{
__published:	// IDE-managed Components
        TEdit *Edit1;
        TEdit *EditB1;
        TEdit *EditB3;
        TButton *Button2;
        TButton *Button3;
        TButton *Button4;
        TButton *Button5;
        TEdit *EditB2;
        TButton *Button6;
        TButton *Button7;
        TButton *Button8;
        TButton *Button9;
        TButton *Button10;
        TButton *Button11;
        TButton *Button12;
        TButton *Button13;
        TLabel *LabelNot;
        TMainMenu *MainMenu1;
        TMenuItem *Options1;
        TMenuItem *SeparatorsCB;
        TMenuItem *About1;
        TMenuItem *WheelRollover1;
        TMenuItem *Notation1;
        TMenuItem *S81;
        TMenuItem *U81;
        TMenuItem *S161;
        TMenuItem *U161;
        TMenuItem *S321;
        TMenuItem *U321;
        TMenuItem *S641;
        TMenuItem *U641;
        TMenuItem *Extended1;
        TMenuItem *N1;
        TLabel *LabelL1;
        TLabel *LabelL2;
        TLabel *LabelL3;
        TStatusBar *StatusBar1;
        TMenuItem *NotatCustom1;
        TMenuItem *N3;
        TPopupMenu *PopupMenuNotationBitmap;
        TMenuItem *SetSignbit1;
        TMenuItem *Markmantissa1;
        TMenuItem *MarkMantissasign1;
        TLabel *Label1;
        TLabel *Label2;
        TLabel *Label3;
        TLabel *Label4;
        TPopupMenu *EditPopupMenu;
        TMenuItem *Copy1;
        TMenuItem *N4;
        TMenuItem *CopyAs1;
        TMenuItem *Csource1;
        TMenuItem *ASMsource1;
        TMenuItem *BASIC1;
        TLabel *Label5;
        TMenuItem *PHPSource1;
        TMenuItem *Float1;
        TMenuItem *Double1;
        TMenuItem *N2;
        TLabel *LabelBitmap;
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall EditB1KeyPress(TObject *Sender, char &Key);
        void __fastcall Button2Click(TObject *Sender);
        void __fastcall Button3Click(TObject *Sender);
        void __fastcall Button4Click(TObject *Sender);
        void __fastcall Button5Click(TObject *Sender);
        void __fastcall Button6Click(TObject *Sender);
        void __fastcall Button7Click(TObject *Sender);
        void __fastcall Button8Click(TObject *Sender);
        void __fastcall Button9Click(TObject *Sender);
        void __fastcall Button10Click(TObject *Sender);
        void __fastcall Button11Click(TObject *Sender);
        void __fastcall Button12Click(TObject *Sender);
        void __fastcall Button13Click(TObject *Sender);
        void __fastcall Edit1Change(TObject *Sender);
        void __fastcall Edit1KeyPress(TObject *Sender, char &Key);
        void __fastcall EditB1Change(TObject *Sender);
        void __fastcall EditB2Change(TObject *Sender);
        void __fastcall EditB3Change(TObject *Sender);
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormMouseWheelDown(TObject *Sender,
          TShiftState Shift, TPoint &MousePos, bool &Handled);
        void __fastcall FormMouseWheelUp(TObject *Sender,
          TShiftState Shift, TPoint &MousePos, bool &Handled);
        void __fastcall About1Click(TObject *Sender);
        void __fastcall Extended1Click(TObject *Sender);
        void __fastcall WheelRollover1Click(TObject *Sender);
        void __fastcall S81Click(TObject *Sender);
        void __fastcall U81Click(TObject *Sender);
        void __fastcall S161Click(TObject *Sender);
        void __fastcall U161Click(TObject *Sender);
        void __fastcall S321Click(TObject *Sender);
        void __fastcall U321Click(TObject *Sender);
        void __fastcall S641Click(TObject *Sender);
        void __fastcall U641Click(TObject *Sender);
        void __fastcall NotatCustom1Click(TObject *Sender);
        void __fastcall LabelL1Click(TObject *Sender);
        void __fastcall LabelL2Click(TObject *Sender);
        void __fastcall LabelL3Click(TObject *Sender);
        void __fastcall Copy1Click(TObject *Sender);
        void __fastcall Csource1Click(TObject *Sender);
        void __fastcall SetSignbit1Click(TObject *Sender);
        void __fastcall Label1MouseMove(TObject *Sender, TShiftState Shift,
          int X, int Y);
private:	// User declarations
        AnsiString cs1,bs1,cs2,bs2,cs3,bs3;
        int notate;
        int bitwidth;
        void UpdateNotation(void);
        int not_n;
        int SignPos;

public:		// User declarations
        __fastcall Tpcfrm(TComponent* Owner);
        int BaseToDec(char* number, int base);
        int GetIndex(char * pString, char search);
        AnsiString Convert(int from, int to, AnsiString s, bool *error);
        AnsiString makeitfancy(int base, AnsiString s);
        void INI_write(void);
        void INI_read(void);
};
//---------------------------------------------------------------------------
extern PACKAGE Tpcfrm *pcfrm;
//---------------------------------------------------------------------------
#endif
